﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Utils;

namespace MyApplication
{
    class Person
    {
        private string _name;

        public Person(string name)
        {
            _name = name;
        }

        public string Name
        {
            get
            {
                return _name;
            }
        }

        public void SayHello()
        {
            Console.WriteLine("hello");
        }

        public void TestStringOf(string paramName)
        {
            string s;
            int localVariable = 0;

            // getting name of local variable
            s = @string.of(() => localVariable);
            Console.WriteLine(s);

            // getting name of parameter
            s = @string.of(() => paramName);
            Console.WriteLine(s);

            // getting name of property
            s = @string.of(() => Name);
            Console.WriteLine(s);

            // getting name of field
            s = @string.of(() => _name);
            Console.WriteLine(s);

            // getting name of function
            s = @string.of(() => SayHello());
            Console.WriteLine(s);

            // getting name of type
            s = @string.of<Person>();
            Console.WriteLine(s);
        }
    }

    class Program
    {
        static void Main(string[] args)
        {
            Person p = new Person("Arik");
            p.TestStringOf("RandomString");
        }
    }
}
